﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GtsServer.Model;
using GtsServer.DAL;
using System.Data;
using GtsServer.Common;

namespace GtsServer.Manage.Controller
{
    public class EventMouldController
    {
        EventChanceMouldDAL mouldDal = new EventChanceMouldDAL();
        public List<EventChanceMould> GetList(int eventID)
        {
            DataSet ds = mouldDal.GetListBuEventID(eventID);
            return IListDataSet.DataSetToIList<EventChanceMould>(ds, 0).ToList();
        }

        public List<EventChanceMould> GetListByEventTypeName()
        {
            DataSet ds = mouldDal.GetListByEventTypeName();
            return IListDataSet.DataSetToIList<EventChanceMould>(ds, 0).ToList();
        }


        public List<EventChanceMould> GetList(string strWhere = "")
        {
            DataSet ds = mouldDal.GetList(strWhere);
            return IListDataSet.DataSetToIList<EventChanceMould>(ds, 0).ToList();
        }

        public int Add(EventChanceMould model)
        {
            return mouldDal.Add(model);
        }

        public bool Update(EventChanceMould model)
        {
            return mouldDal.Update(model);
        }

        public bool Delete(int id)
        {
            return mouldDal.Delete(id);
        }

        public bool DeleteByEventID(int eventID)
        {
            return mouldDal.DeleteByEventID(eventID);
        }
    }
}
